package com.ittony.model.system;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ittony.model.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel(description = "Menu")
@TableName("sys_menu")
public class SysMenu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "Superior")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty(value = "Name")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "Type(1:Menu,2:Button)")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "RouteAddr")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "ComponentPath")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "PermissionTag")
    @TableField("perms")
    private String perms;

    @ApiModelProperty(value = "Icon")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "Sort")
    @TableField("sort_value")
    private Integer sortValue;

    @ApiModelProperty(value = "Status(0:Stop,1:Normal)")
    @TableField("status")
    private Integer status;

    //Subordinate List
    @TableField(exist = false)
    private List<SysMenu> children;

    //Is it selected?
    @TableField(exist = false)
    private boolean isSelect;
}
